package com.taojie.graduation.controller;

import com.taojie.graduation.service.api.LogisticsService;
import com.taojie.graduation.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName LogisticsController
 * @Description TODO
 * @Author Chole
 * @Date 2020/4/20 13:02
 */
@RestController
@CrossOrigin
@Api(tags = {"物流信息接口"})
@RequestMapping("logistics")
public class LogisticsController {

    @Resource
    private LogisticsService logisticsService;

    @ApiOperation("分页查询")
    @GetMapping("{page}/{size}")
    public Result page(@PathVariable("page") int page, @PathVariable("size") int size){
        return logisticsService.findLogisticsPage(page, size);
    }

    @ApiOperation("根据id查询订单")
    @GetMapping("{id}")
    public Result findById(@PathVariable("id") Integer id){
        return logisticsService.findLogisticsById(id);
    }

    /*@ApiOperation("根据id更新订单")
    @PutMapping("{id}")
    public Result updateById(@PathVariable("id") Integer id,@RequestBody Logistics logistics){
        logistics.setId(id);
        return logisticsService.updateById(logistics);
    }*/

/*
    @ApiOperation("根据id删除订单")
    @DeleteMapping("{id}")
    public Result deleteById(@PathVariable("id")Integer id){
        return logisticsService.deleteById(id);
    }
*/
    
}
